package cn.monkey.family.server.domain.shop.item;

import cn.monkey.family.data.shop.item.ItemMapper;
import org.mapstruct.factory.Mappers;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ItemConfig {
    @Bean
    ItemMapper itemMapper() {
        return Mappers.getMapper(ItemMapper.class);
    }

    @Bean
    CheckItemExistBeforeOrderCreateEventListener itemChecker(ItemRepository itemRepository) {
        return new CheckItemExistBeforeOrderCreateEventListener(itemRepository);
    }
}
